{% extends 'layout.html' %}

{% block title %}
    {{ title }}
{% endblock title %}

{% load static %}
{% block css %}
    <link rel="stylesheet" href="{% static 'plugins/bootstrap-datepicker-1.9.0/css/bootstrap-datepicker.css' %}">
{% endblock css %}

{% block content %}
    <div class="container">
        {#面板#}
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">{{ title }}</h3>
            </div>
            <div class="panel-body">
                {#表单#}
                <form method="post" novalidate>
                    {% csrf_token %}

                    {% for obj in form %}
                        <div class="form-group">
                            <label>{{ obj.label }}</label>
                            {{ obj }}
                            <span style="color: red">{{ obj.errors.0 }}</span>
                        </div>
                    {% endfor %}

                    <button type="submit" class="btn btn-primary">提 交</button>
                </form>
            </div>
        </div>
    </div>
{% endblock content %}

{% block js %}
    <script src="{% static 'plugins/bootstrap-datepicker-1.9.0/js/bootstrap-datepicker.js' %}"></script>
    <script src="{% static 'plugins/bootstrap-datepicker-1.9.0/locales/bootstrap-datepicker.zh-CN.min.js' %}"></script>
    <script>
        $(function (){
            $('#id_create_time').datepicker({
                format : 'yyyy-mm-dd',
                startDate : '0',
                language : 'zh-CN',
                autoclose : true
            });
        })
    </script>
{% endblock js %}